<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
<script>
    var age=prompt("输入你的年龄:");
    if(age>=18){
        alert('你已经成年了，你要对自己负责')
    }
    else{
        alert('未成年');
    }
</script>
</body>
</html>